package com.biscuit.page.basicservice.design.websocket.register;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author biscuit
 * @createTime 2024/6/22 14:36
 */
@Getter
public enum WebSocketRegisterTypeEnum {

    CHAT_ROOM_REGISTER(1, "聊天室注册"),
    AI_CHAT_SESSION_REGISTER(2, "AI 聊天会话注册");

    private final int type;

    private final String desc;

    WebSocketRegisterTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static WebSocketRegisterTypeEnum getEnumByType(int type) {
        return Arrays.stream(WebSocketRegisterTypeEnum.values())
                .filter(x -> x.getType() == type).findFirst().orElse(null);
    }

}
